package com.Ivy.exercise.Lei;

import java.io.Serializable;

public class Student implements Serializable {
    //序列化版本号，显示声明，不声明可能会导致反序列化的时候发生异常
    static final long serialVersionUID = 42L;
    private String stuName;
    private transient int stuNo; //加上transient属性不会被序列化
    private boolean stuSex;

    public Student() {
    }

    public Student(String stuName, int stuNo, boolean stuSex) {
        this.stuName = stuName;
        this.stuNo = stuNo;
        this.stuSex = stuSex;
    }

    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public int getStuNo() {
        return stuNo;
    }

    public void setStuNo(int stuNo) {
        this.stuNo = stuNo;
    }

    public boolean isStuSex() {
        return stuSex;
    }

    public void setStuSex(boolean stuSex) {
        this.stuSex = stuSex;
    }

    @Override
    public String toString() {
        return "Student{" +
                "stuName='" + stuName + '\'' +
                ", stuNo=" + stuNo +
                ", stuSex=" + stuSex +
                '}';
    }
}
